#ifndef _DSWCONSOLE_CENTER_H
#define _DSWCONSOLE_CENTER_H

#include "dswconsole_rf.h"
#include "dswconsole_rf_915.h"
#include "dswconsole_key.h"
#include "dswconsole_tel.h"

typedef struct{
	ST_PTZ_T nPtz;
	int nDelay100ms;
} ST_DELAY_PTZ_T, *LPST_DELAY_PTZ_T;

typedef std::list<LPST_DELAY_PTZ_T> LIST_DELAY_PTZ_T, *LPLIST_DELAY_PTZ_T;

class CDswconsole_center
{
public:
	CDswconsole_center(LPST_ENV_T pEnv);
	virtual ~CDswconsole_center();
public:
	int BroadcastCmd(LPST_UPDATE_CONSOLE_T pUpdateParam);
	void PTZControl(int nCh, int nCode, int nSpeed);
	int ResetRollCode(bool bPL, lpst_sl_t pSl);
protected:
	static void cbPTZTaskFunc(int fd, short events, void* ctx){((CDswconsole_center*)ctx)->PTZTaskFunc(fd, events);};
	void PTZTaskFunc(int fd, short events);
private:
	LPST_ENV_T m_pEnv;
	CDswconsole_rf* m_pRf;
	CDswconsole_rf_915* m_pRf_915;
	CDswconsole_tel* m_pTel;
	CDswconsole_key* m_pKeyboard;
	timer_param_t m_nPTZTask;
	LIST_DELAY_PTZ_T m_nListDelayPtz;
	pthread_mutex_t m_nDelayPtzLock;
};

#endif

